<!DOCTYPE html>
<html lang="zh-CN" data-theme="light">

<head>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width,initial-scale=1" />
  <meta name="generator" content="VuePress 2.0.0-beta.51" />
  <meta name="theme" content="VuePress Theme Hope" />
  <meta property="og:url" content="https://pro.autojs.org/docs/zh/v8/app.html">
  <meta property="og:site_name" content="Auto.js Pro文档">
  <meta property="og:title" content="app - 应用">
  <meta property="og:type" content="article">
  <meta property="og:updated_time" content="2022-10-22T07:36:15.000Z">
  <meta property="og:locale" content="zh-CN">
  <meta property="og:locale:alternate" content="en-US">
  <meta property="article:modified_time" content="2022-10-22T07:36:15.000Z">
  <link rel="alternate" hreflang="en-us" href="https://pro.autojs.org/docs/en/zh/v8/app.html">
  <link rel="icon" href="https://pro.autojs.org/docs/favicon.ico">
  <link rel="manifest" href="https://pro.autojs.org/docs/manifest.webmanifest" crossorigin="use-credentials">
  <meta name="theme-color" content="#46bd87">
  <meta name="viewport"
    content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover">
  <title>app - 应用 | Auto.js Pro文档</title>
  <meta name="description" content="支持Node.js的自动化工作流JavaScript IDE">
  <style>
    :root {
      --bg-color: #fff;
    }

    html[data-theme="dark"] {
      --bg-color: #1d2025;
    }

    html,
    body {
      background-color: var(--bg-color);
    }
  </style>
  <script>
    const userMode = localStorage.getItem("vuepress-theme-hope-scheme");
    const systemDarkMode =
      window.matchMedia &&
      window.matchMedia("(prefers-color-scheme: dark)").matches;

    if (userMode === "dark" || (userMode !== "light" && systemDarkMode)) {
      document.querySelector("html").setAttribute("data-theme", "dark");
    }
  </script>
  <link rel="stylesheet" href="../../assets/style.ae9cb182.css">
  <link rel="modulepreload" href="../../assets/app.6aa2b576.js">
  <link rel="modulepreload" href="../../assets/app.html.004a89b7.js">
  <link rel="modulepreload" href="../../assets/_plugin-vue_export-helper.cdc0426e.js">
  <link rel="modulepreload" href="../../assets/app.html.79d7bc17.js">
</head>

<body>


  <!-- Copyright � 2008. Spidersoft Ltd -->
  <style>
    A.applink:hover {
      border: 2px dotted #DCE6F4;
      padding: 2px;
      background-color: #ffff00;
      color: green;
      text-decoration: none
    }

    A.applink {
      border: 2px dotted #DCE6F4;
      padding: 2px;
      color: #2F5BFF;
      background: transparent;
      text-decoration: none
    }

    A.info {
      color: #2F5BFF;
      background: transparent;
      text-decoration: none
    }

    A.info:hover {
      color: green;
      background: transparent;
      text-decoration: underline
    }
  </style>



  <div id="app"><!--[--><!--[--><!--[--><span tabindex="-1"></span><a href="#main-content"
      class="skip-link sr-only">Skip to content</a><!--]-->
    <div class="theme-container has-toc"><!--[--><!--[-->
      <header class="navbar">
        <div class="navbar-left"><button class="toggle-sidebar-button" title="Toggle Sidebar"><span
              class="icon"></span></button><!----><a href="../../docs.html" class="brand"><img class="logo"
              src="../../logo.png" alt="Auto.js Pro文档"><!----><span class="site-name hide-in-pad">Auto.js
              Pro文档</span></a><!----></div>
        <div class="navbar-center"><!---->
          <nav class="nav-links">
            <div class="nav-item hide-in-mobile"><a href="../../docs.html" class="nav-link"
                aria-label="Auto.js Pro"><span class="icon iconfont icon-home"></span>Auto.js Pro<!----></a></div>
            <div class="nav-item hide-in-mobile"><a href="../guide/guide.html" class="nav-link" aria-label="指南"><span
                  class="icon iconfont icon-creative"></span>指南<!----></a></div>
            <div class="nav-item hide-in-mobile"><a href="v8.html" class="nav-link active" aria-label="第一代API文档"><span
                  class="icon iconfont icon-note"></span>第一代API文档<!----></a></div>
            <div class="nav-item hide-in-mobile"><a href="../v9/v9.html" class="nav-link" aria-label="第二代API文档"><span
                  class="icon iconfont icon-note"></span>第二代API文档<!----></a></div>
            <div class="nav-item hide-in-mobile">
              <div class="dropdown-wrapper"><button class="dropdown-title" type="button" aria-label="官网与相关链接"><span
                    class="title"><span class="icon iconfont icon-discover"></span>官网与相关链接</span><span
                    class="arrow"></span>
                  <ul class="nav-dropdown">
                    <li class="dropdown-item"><a href="../../../pro.autojs.html" rel="noopener noreferrer"
                        target="_blank" aria-label="官网与软件下载" class="nav-link"><!---->官网与软件下载<span><svg
                            class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"
                            focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15">
                            <path fill="currentColor"
                              d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z">
                            </path>
                            <polygon fill="currentColor"
                              points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9">
                            </polygon>
                          </svg><span class="external-link-icon-sr-only">open in new window</span></span><!----></a>
                    </li>

                    <li class="dropdown-item"><a href="https://pd.qq.com/s/gosos5" rel="noopener noreferrer"
                        target="_blank" aria-label="官方频道" class="nav-link"><!---->官方频道<span><svg
                            class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"
                            focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15">
                            <path fill="currentColor"
                              d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z">
                            </path>
                            <polygon fill="currentColor"
                              points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9">
                            </polygon>
                          </svg><span class="external-link-icon-sr-only">open in new window</span></span><!----></a>
                    </li>
                  </ul>
                </button></div>
            </div>
          </nav><!---->
        </div>
        <div class="navbar-right"><!---->
          <div class="nav-item">
            <div class="dropdown-wrapper i18n-dropdown"><button class="dropdown-title" type="button"
                aria-label="选择语言"><!--[--><svg xmlns="http://www.w3.org/2000/svg" class="icon i18n-icon"
                  viewBox="0 0 1024 1024" fill="currentColor" aria-label="i18n icon"
                  style="width:1rem;height:1rem;vertical-align:middle;">
                  <path
                    d="M379.392 460.8 494.08 575.488l-42.496 102.4L307.2 532.48 138.24 701.44l-71.68-72.704L234.496 460.8l-45.056-45.056c-27.136-27.136-51.2-66.56-66.56-108.544h112.64c7.68 14.336 16.896 27.136 26.112 35.84l45.568 46.08 45.056-45.056C382.976 312.32 409.6 247.808 409.6 204.8H0V102.4h256V0h102.4v102.4h256v102.4H512c0 70.144-37.888 161.28-87.04 210.944L378.88 460.8zM576 870.4 512 1024H409.6l256-614.4H768l256 614.4H921.6l-64-153.6H576zM618.496 768h196.608L716.8 532.48 618.496 768z">
                  </path>
                </svg><!--]--><span class="arrow"></span>
                <ul class="nav-dropdown">
                  <li class="dropdown-item"><a href="../../en/en.html" class="nav-link"
                      aria-label="English"><!---->English<!----></a></li>
                  <li class="dropdown-item"><a aria-current="page" href="app.html"
                      class="router-link-active router-link-exact-active nav-link active"
                      aria-label="简体中文"><!---->简体中文<!----></a></li>
                </ul>
              </button></div>
          </div><!---->
          <div class="nav-item hide-in-mobile"><button id="appearance-switch"><svg xmlns="http://www.w3.org/2000/svg"
                class="icon auto-icon" viewBox="0 0 1024 1024" fill="currentColor" aria-label="auto icon"
                style="display:block;">
                <path
                  d="M512 992C246.92 992 32 777.08 32 512S246.92 32 512 32s480 214.92 480 480-214.92 480-480 480zm0-840c-198.78 0-360 161.22-360 360 0 198.84 161.22 360 360 360s360-161.16 360-360c0-198.78-161.22-360-360-360zm0 660V212c165.72 0 300 134.34 300 300 0 165.72-134.28 300-300 300z">
                </path>
              </svg><svg xmlns="http://www.w3.org/2000/svg" class="icon dark-icon" viewBox="0 0 1024 1024"
                fill="currentColor" aria-label="dark icon" style="display:none;">
                <path
                  d="M524.8 938.667h-4.267a439.893 439.893 0 0 1-313.173-134.4 446.293 446.293 0 0 1-11.093-597.334A432.213 432.213 0 0 1 366.933 90.027a42.667 42.667 0 0 1 45.227 9.386 42.667 42.667 0 0 1 10.24 42.667 358.4 358.4 0 0 0 82.773 375.893 361.387 361.387 0 0 0 376.747 82.774 42.667 42.667 0 0 1 54.187 55.04 433.493 433.493 0 0 1-99.84 154.88 438.613 438.613 0 0 1-311.467 128z">
                </path>
              </svg><svg xmlns="http://www.w3.org/2000/svg" class="icon light-icon" viewBox="0 0 1024 1024"
                fill="currentColor" aria-label="light icon" style="display:none;">
                <path
                  d="M952 552h-80a40 40 0 0 1 0-80h80a40 40 0 0 1 0 80zM801.88 280.08a41 41 0 0 1-57.96-57.96l57.96-58a41.04 41.04 0 0 1 58 58l-58 57.96zM512 752a240 240 0 1 1 0-480 240 240 0 0 1 0 480zm0-560a40 40 0 0 1-40-40V72a40 40 0 0 1 80 0v80a40 40 0 0 1-40 40zm-289.88 88.08-58-57.96a41.04 41.04 0 0 1 58-58l57.96 58a41 41 0 0 1-57.96 57.96zM192 512a40 40 0 0 1-40 40H72a40 40 0 0 1 0-80h80a40 40 0 0 1 40 40zm30.12 231.92a41 41 0 0 1 57.96 57.96l-57.96 58a41.04 41.04 0 0 1-58-58l58-57.96zM512 832a40 40 0 0 1 40 40v80a40 40 0 0 1-80 0v-80a40 40 0 0 1 40-40zm289.88-88.08 58 57.96a41.04 41.04 0 0 1-58 58l-57.96-58a41 41 0 0 1 57.96-57.96z">
                </path>
              </svg></button></div>
          <div class="search-box" role="search" data-v-f3875574><input value="" aria-label="Search" class=""
              placeholder="Search" autocomplete="off" spellcheck="false" data-v-f3875574><!----></div><!----><button
            class="toggle-navbar-button" aria-label="Toggle Navbar" aria-expanded="false"
            aria-controls="nav-screen"><span class="button-container"><span class="button-top"></span><span
                class="button-middle"></span><span class="button-bottom"></span></span></button>
        </div>
      </header><!----><!--]--><!---->
      <div class="toggle-sidebar-wrapper"><span class="arrow left"></span></div>
      <aside class="sidebar"><!--[--><!----><!--]-->
        <ul class="sidebar-links">
          <li>
            <section class="sidebar-group">
              <p class="sidebar-heading"><!----><span class="title">指南</span><!----></p>
              <ul class="sidebar-links">
                <li><!--[--><a href="v8.html" class="nav-link sidebar-link sidebar-page"
                    aria-label="阅读须知"><!---->阅读须知<!----></a>
                  <ul class="sidebar-sub-headers"></ul><!--]-->
                </li>
              </ul>
            </section>
          </li>
          <li>
            <section class="sidebar-group">
              <p class="sidebar-heading"><!----><span class="title">API文档</span><!----></p>
              <ul class="sidebar-links">
                <li>
                  <section class="sidebar-group"><button class="sidebar-heading clickable"><!----><span
                        class="title">自动化 -
                        控件操作</span><span class="arrow down"></span></button>
                    <ul class="sidebar-links">
                      <li><!--[--><a href="./automator/"
                          class="router-link-active router-link-exact-active nav-link sidebar-link sidebar-page"
                          aria-label="入门介绍" aria-current="page"><!---->入门介绍<!----></a>
                        <ul class="sidebar-sub-headers"></ul><!--]-->
                      </li>
                      <li><!--[--><a href="./automator/selector.html" class="nav-link sidebar-link sidebar-page"
                          aria-label="选择器"><!---->选择器<!----></a>
                        <ul class="sidebar-sub-headers"></ul><!--]-->
                      </li>
                      <li><!--[--><a href="./automator/uiobject.html" class="nav-link sidebar-link sidebar-page"
                          aria-label="控件和控件集合"><!---->控件和控件集合<!----></a>
                        <ul class="sidebar-sub-headers"></ul><!--]-->
                      </li>
                      <li><!--[--><a href="./automator/api.html" class="nav-link sidebar-link sidebar-page"
                          aria-label="automator与其他函数"><!---->automator与其他函数<!----></a>
                        <ul class="sidebar-sub-headers"></ul><!--]-->
                      </li>
                    </ul>
                  </section>
                </li>
                <li><!--[--><a href="./coordinatesBasedAutomation.html" class="nav-link sidebar-link sidebar-page"
                    aria-label="自动化 - 坐标操作"><!---->自动化 -
                    坐标操作<!----></a>
                  <ul class="sidebar-sub-headers"></ul><!--]-->
                </li>
                <li><!--[--><a href="./app.html" class="nav-link sidebar-link sidebar-page active"
                    aria-label="app - 应用"><!---->app -
                    应用<!----></a>
                  <ul class="sidebar-sub-headers"></ul><!--]-->
                </li>
                <li><!--[--><a href="./base64.html" class="nav-link sidebar-link sidebar-page"
                    aria-label="base64"><!---->base64<!----></a>
                  <ul class="sidebar-sub-headers"></ul><!--]-->
                </li>
                <li><!--[--><a href="./colors.html" class="nav-link sidebar-link sidebar-page"
                    aria-label="colors - 颜色"><!---->colors - 颜色<!----></a>
                  <ul class="sidebar-sub-headers"></ul><!--]-->
                </li>
                <li><!--[--><a href="./canvas.html" class="nav-link sidebar-link sidebar-page"
                    aria-label="canvas - 画布"><!---->canvas - 画布<!----></a>
                  <ul class="sidebar-sub-headers"></ul><!--]-->
                </li>
                <li><!--[--><a href="./console.html" class="nav-link sidebar-link sidebar-page"
                    aria-label="console - 控制台"><!---->console - 控制台<!----></a>
                  <ul class="sidebar-sub-headers"></ul><!--]-->
                </li>
                <li><!--[--><a href="./crypto.html" class="nav-link sidebar-link sidebar-page"
                    aria-label="crypto - 加解密与消息摘要"><!---->crypto - 加解密与消息摘要<!----></a>
                  <ul class="sidebar-sub-headers"></ul><!--]-->
                </li>
                <li><!--[--><a href="./debug.html" class="nav-link sidebar-link sidebar-page"
                    aria-label="debug - 调试工具"><!---->debug - 调试工具<!----></a>
                  <ul class="sidebar-sub-headers"></ul><!--]-->
                </li>
                <li><!--[--><a href="./device.html" class="nav-link sidebar-link sidebar-page"
                    aria-label="device - 设备"><!---->device - 设备<!----></a>
                  <ul class="sidebar-sub-headers"></ul><!--]-->
                </li>
                <li><!--[--><a href="./dialogs.html" class="nav-link sidebar-link sidebar-page"
                    aria-label="dialogs - 对话框"><!---->dialogs - 对话框<!----></a>
                  <ul class="sidebar-sub-headers"></ul><!--]-->
                </li>
                <li><!--[--><a href="./engines.html" class="nav-link sidebar-link sidebar-page"
                    aria-label="engines - 脚本引擎"><!---->engines - 脚本引擎<!----></a>
                  <ul class="sidebar-sub-headers"></ul><!--]-->
                </li>
                <li><!--[--><a href="./events.html" class="nav-link sidebar-link sidebar-page"
                    aria-label="events - 事件与监听"><!---->events - 事件与监听<!----></a>
                  <ul class="sidebar-sub-headers"></ul><!--]-->
                </li>
                <li><!--[--><a href="./floaty.html" class="nav-link sidebar-link sidebar-page"
                    aria-label="floaty - 悬浮窗"><!---->floaty - 悬浮窗<!----></a>
                  <ul class="sidebar-sub-headers"></ul><!--]-->
                </li>
                <li><!--[--><a href="./files.html" class="nav-link sidebar-link sidebar-page"
                    aria-label="files - 文件系统"><!---->files - 文件系统<!----></a>
                  <ul class="sidebar-sub-headers"></ul><!--]-->
                </li>
                <li><!--[--><a href="./globals.html" class="nav-link sidebar-link sidebar-page"
                    aria-label="globals - 全局变量与函数"><!---->globals - 全局变量与函数<!----></a>
                  <ul class="sidebar-sub-headers"></ul><!--]-->
                </li>
                <li><!--[--><a href="./http.html" class="nav-link sidebar-link sidebar-page"
                    aria-label="http - HTTP网络请求"><!---->http - HTTP网络请求<!----></a>
                  <ul class="sidebar-sub-headers"></ul><!--]-->
                </li>
                <li><!--[--><a href="./images.html" class="nav-link sidebar-link sidebar-page"
                    aria-label="images - 图片处理"><!---->images - 图片处理<!----></a>
                  <ul class="sidebar-sub-headers"></ul><!--]-->
                </li>
                <li><!--[--><a href="./keys.html" class="nav-link sidebar-link sidebar-page"
                    aria-label="keys - 按键模拟"><!---->keys
                    - 按键模拟<!----></a>
                  <ul class="sidebar-sub-headers"></ul><!--]-->
                </li>
                <li><!--[--><a href="./media.html" class="nav-link sidebar-link sidebar-page"
                    aria-label="media - 多媒体"><!---->media
                    - 多媒体<!----></a>
                  <ul class="sidebar-sub-headers"></ul><!--]-->
                </li>
                <li><!--[--><a href="./modules.html" class="nav-link sidebar-link sidebar-page"
                    aria-label="module - 模块"><!---->module - 模块<!----></a>
                  <ul class="sidebar-sub-headers"></ul><!--]-->
                </li>
                <li><!--[--><a href="./ocr.html" class="nav-link sidebar-link sidebar-page"
                    aria-label="ocr - 文字识别"><!---->ocr -
                    文字识别<!----></a>
                  <ul class="sidebar-sub-headers"></ul><!--]-->
                </li>
                <li><!--[--><a href="./plugins.html" class="nav-link sidebar-link sidebar-page"
                    aria-label="plugins - 插件"><!---->plugins - 插件<!----></a>
                  <ul class="sidebar-sub-headers"></ul><!--]-->
                </li>
                <li><!--[--><a href="./powerManager.html" class="nav-link sidebar-link sidebar-page"
                    aria-label="power_manager - 电源管理"><!---->power_manager - 电源管理<!----></a>
                  <ul class="sidebar-sub-headers"></ul><!--]-->
                </li>
                <li><!--[--><a href="./sensors.html" class="nav-link sidebar-link sidebar-page"
                    aria-label="sensors - 传感器"><!---->sensors - 传感器<!----></a>
                  <ul class="sidebar-sub-headers"></ul><!--]-->
                </li>
                <li><!--[--><a href="./shell.html" class="nav-link sidebar-link sidebar-page"
                    aria-label="shell - Shell命令"><!---->shell - Shell命令<!----></a>
                  <ul class="sidebar-sub-headers"></ul><!--]-->
                </li>
                <li><!--[--><a href="./storages.html" class="nav-link sidebar-link sidebar-page"
                    aria-label="storages - 本地存储"><!---->storages - 本地存储<!----></a>
                  <ul class="sidebar-sub-headers"></ul><!--]-->
                </li>
                <li><!--[--><a href="./settings.html" class="nav-link sidebar-link sidebar-page"
                    aria-label="settings - 设置"><!---->settings - 设置<!----></a>
                  <ul class="sidebar-sub-headers"></ul><!--]-->
                </li>
                <li><!--[--><a href="./threads.html" class="nav-link sidebar-link sidebar-page"
                    aria-label="threads - 多线程"><!---->threads - 多线程<!----></a>
                  <ul class="sidebar-sub-headers"></ul><!--]-->
                </li>
                <li><!--[--><a href="./timers.html" class="nav-link sidebar-link sidebar-page"
                    aria-label="timers - 定时器"><!---->timers - 定时器<!----></a>
                  <ul class="sidebar-sub-headers"></ul><!--]-->
                </li>
                <li><!--[--><a href="./timedTasks.html" class="nav-link sidebar-link sidebar-page"
                    aria-label="work_manager - 定时与任务"><!---->work_manager - 定时与任务<!----></a>
                  <ul class="sidebar-sub-headers"></ul><!--]-->
                </li>
                <li>
                  <section class="sidebar-group"><button class="sidebar-heading clickable"><!----><span
                        class="title">ui - 用户界面</span><span class="arrow down"></span></button>
                    <ul class="sidebar-links">
                      <li><a href="/docs/zh/v8/ui/ui.html" class="nav-link sidebar-link sidebar-page"
                          aria-label="ui入门介绍"><!---->ui入门介绍<!----></a>
                        <ul class="sidebar-sub-headers"></ul>
                      </li>
                      <li><a href="/docs/zh/v8/ui/basic.html" class="nav-link sidebar-link sidebar-page"
                          aria-label="基础布局与控件"><!---->基础布局与控件<!----></a>
                        <ul class="sidebar-sub-headers"></ul>
                      </li>
                      <li><a href="/docs/zh/v8/ui/advanced.html" class="nav-link sidebar-link sidebar-page"
                          aria-label="其他布局与控件"><!---->其他布局与控件<!----></a>
                        <ul class="sidebar-sub-headers"></ul>
                      </li>
                      <li><a href="/docs/zh/v8/ui/api.html" class="nav-link sidebar-link sidebar-page"
                          aria-label="api文档"><!---->api文档<!----></a>
                        <ul class="sidebar-sub-headers"></ul>
                      </li>
                      <li><a href="/docs/zh/v8/ui/customWidget.html" class="nav-link sidebar-link sidebar-page"
                          aria-label="自定义控件"><!---->自定义控件<!----></a>
                        <ul class="sidebar-sub-headers"></ul>
                      </li>
                      <li><a aria-current="page" href="/docs/zh/v8/ui/webview.html"
                          class="router-link-active router-link-exact-active nav-link sidebar-link sidebar-page"
                          aria-label="使用Web编写界面"><!---->使用Web编写界面<!----></a>
                        <ul class="sidebar-sub-headers"></ul>
                      </li>
                    </ul>
                  </section>
                </li>
                <li><!--[--><a href="./util.html" class="nav-link sidebar-link sidebar-page"
                    aria-label="util - 工具"><!---->util -
                    工具<!----></a>
                  <ul class="sidebar-sub-headers"></ul><!--]-->
                </li>
                <li><!--[--><a href="./webSocket.html" class="nav-link sidebar-link sidebar-page"
                    aria-label="WebSocket"><!---->WebSocket<!----></a>
                  <ul class="sidebar-sub-headers"></ul><!--]-->
                </li>
                <li><!--[--><a href="./zip.html" class="nav-link sidebar-link sidebar-page"
                    aria-label="zip - 压缩与解压"><!---->zip -
                    压缩与解压<!----></a>
                  <ul class="sidebar-sub-headers"></ul><!--]-->
                </li>
              </ul>
            </section>
          </li>
          <li>
            <section class="sidebar-group">
              <p class="sidebar-heading"><!----><span class="title">进阶</span><!----></p>
              <ul class="sidebar-links">
                <li><!--[--><a href="scriptingJava.html" class="nav-link sidebar-link sidebar-page"
                    aria-label="和Java交互"><!---->和Java交互<!----></a>
                  <ul class="sidebar-sub-headers"></ul><!--]-->
                </li>
              </ul>
            </section>
          </li>
        </ul><!--[--><!----><!--]-->
      </aside><!--[-->
      <main class="page" id="main-content"><!--[--><!---->
        <nav class="breadcrumb disable"></nav>
        <div class="page-title">
          <h1><!---->app - 应用</h1>
          <div class="page-info"><span class="date-info" aria-label="写作日期📅" data-balloon-pos="down"><svg
                xmlns="http://www.w3.org/2000/svg" class="icon calendar-icon" viewBox="0 0 1024 1024"
                fill="currentColor" aria-label="calendar icon">
                <path
                  d="M716.4 110.137c0-18.753-14.72-33.473-33.472-33.473-18.753 0-33.473 14.72-33.473 33.473v33.473h66.993v-33.473zm-334.87 0c0-18.753-14.72-33.473-33.473-33.473s-33.52 14.72-33.52 33.473v33.473h66.993v-33.473zm468.81 33.52H716.4v100.465c0 18.753-14.72 33.473-33.472 33.473a33.145 33.145 0 01-33.473-33.473V143.657H381.53v100.465c0 18.753-14.72 33.473-33.473 33.473a33.145 33.145 0 01-33.473-33.473V143.657H180.6A134.314 134.314 0 0046.66 277.595v535.756A134.314 134.314 0 00180.6 947.289h669.74a134.36 134.36 0 00133.94-133.938V277.595a134.314 134.314 0 00-133.94-133.938zm33.473 267.877H147.126a33.145 33.145 0 01-33.473-33.473c0-18.752 14.72-33.473 33.473-33.473h736.687c18.752 0 33.472 14.72 33.472 33.473a33.145 33.145 0 01-33.472 33.473z">
                </path>
              </svg><span>2022年10月22日</span>
              <meta property="datePublished" content="2022-10-22T07:36:15.000Z">
            </span></div>
          <hr>
        </div>
        <div class="toc-place-holder">
          <aside id="toc">
            <div class="toc-header">此页内容</div>
            <div class="toc-wrapper">
              <ul class="toc-list"><!--[-->
                <li class="toc-item"><a aria-current="page"
                    href="https://pro.autojs.org/docs/zh/v8/app.html#app-versioncode"
                    class="router-link-active router-link-exact-active toc-link level2">app.versionCode</a></li>
                <!----><!--]--><!--[-->
                <li class="toc-item"><a aria-current="page"
                    href="https://pro.autojs.org/docs/zh/v8/app.html#app-versionname"
                    class="router-link-active router-link-exact-active toc-link level2">app.versionName</a></li>
                <!----><!--]--><!--[-->
                <li class="toc-item"><a aria-current="page"
                    href="https://pro.autojs.org/docs/zh/v8/app.html#app-autojs-versioncode"
                    class="router-link-active router-link-exact-active toc-link level2">app.autojs.versionCode</a></li>
                <!----><!--]--><!--[-->
                <li class="toc-item"><a aria-current="page"
                    href="https://pro.autojs.org/docs/zh/v8/app.html#app-autojs-versionname"
                    class="router-link-active router-link-exact-active toc-link level2">app.autojs.versionName</a></li>
                <!----><!--]--><!--[-->
                <li class="toc-item"><a aria-current="page"
                    href="https://pro.autojs.org/docs/zh/v8/app.html#app-launchapp-appname"
                    class="router-link-active router-link-exact-active toc-link level2">app.launchApp(appName)</a></li>
                <!----><!--]--><!--[-->
                <li class="toc-item"><a aria-current="page"
                    href="https://pro.autojs.org/docs/zh/v8/app.html#app-launch-packagename"
                    class="router-link-active router-link-exact-active toc-link level2">app.launch(packageName)</a></li>
                <!----><!--]--><!--[-->
                <li class="toc-item"><a aria-current="page"
                    href="https://pro.autojs.org/docs/zh/v8/app.html#app-launchpackage-packagename"
                    class="router-link-active router-link-exact-active toc-link level2">app.launchPackage(packageName)</a>
                </li><!----><!--]--><!--[-->
                <li class="toc-item"><a aria-current="page"
                    href="https://pro.autojs.org/docs/zh/v8/app.html#app-getpackagename-appname"
                    class="router-link-active router-link-exact-active toc-link level2">app.getPackageName(appName)</a>
                </li><!----><!--]--><!--[-->
                <li class="toc-item"><a aria-current="page"
                    href="https://pro.autojs.org/docs/zh/v8/app.html#app-getappname-packagename"
                    class="router-link-active router-link-exact-active toc-link level2">app.getAppName(packageName)</a>
                </li><!----><!--]--><!--[-->
                <li class="toc-item"><a aria-current="page"
                    href="https://pro.autojs.org/docs/zh/v8/app.html#app-openappsetting-packagename"
                    class="router-link-active router-link-exact-active toc-link level2">app.openAppSetting(packageName)</a>
                </li><!----><!--]--><!--[-->
                <li class="toc-item"><a aria-current="page"
                    href="https://pro.autojs.org/docs/zh/v8/app.html#app-viewfile-path"
                    class="router-link-active router-link-exact-active toc-link level2">app.viewFile(path)</a></li>
                <!----><!--]--><!--[-->
                <li class="toc-item"><a aria-current="page"
                    href="https://pro.autojs.org/docs/zh/v8/app.html#app-editfile-path"
                    class="router-link-active router-link-exact-active toc-link level2">app.editFile(path)</a></li>
                <!----><!--]--><!--[-->
                <li class="toc-item"><a aria-current="page"
                    href="https://pro.autojs.org/docs/zh/v8/app.html#app-uninstall-packagename"
                    class="router-link-active router-link-exact-active toc-link level2">app.uninstall(packageName)</a>
                </li><!----><!--]--><!--[-->
                <li class="toc-item"><a aria-current="page"
                    href="https://pro.autojs.org/docs/zh/v8/app.html#app-openurl-url"
                    class="router-link-active router-link-exact-active toc-link level2">app.openUrl(url)</a></li>
                <!----><!--]--><!--[-->
                <li class="toc-item"><a aria-current="page"
                    href="https://pro.autojs.org/docs/zh/v8/app.html#app-sendemail-options"
                    class="router-link-active router-link-exact-active toc-link level2">app.sendEmail(options)</a></li>
                <!----><!--]--><!--[-->
                <li class="toc-item"><a aria-current="page"
                    href="https://pro.autojs.org/docs/zh/v8/app.html#app-startactivity-name"
                    class="router-link-active router-link-exact-active toc-link level2">app.startActivity(name)</a></li>
                <!----><!--]--><!--[-->
                <li class="toc-item"><a aria-current="page"
                    href="https://pro.autojs.org/docs/zh/v8/app.html#app-intent-options"
                    class="router-link-active router-link-exact-active toc-link level2">app.intent(options)</a></li>
                <!----><!--]--><!--[-->
                <li class="toc-item"><a aria-current="page"
                    href="https://pro.autojs.org/docs/zh/v8/app.html#app-startactivity-options"
                    class="router-link-active router-link-exact-active toc-link level2">app.startActivity(options)</a>
                </li><!----><!--]--><!--[-->
                <li class="toc-item"><a aria-current="page"
                    href="https://pro.autojs.org/docs/zh/v8/app.html#app-sendbroadcast-options"
                    class="router-link-active router-link-exact-active toc-link level2">app.sendBroadcast(options)</a>
                </li><!----><!--]--><!--[-->
                <li class="toc-item"><a aria-current="page"
                    href="https://pro.autojs.org/docs/zh/v8/app.html#app-startservice-options"
                    class="router-link-active router-link-exact-active toc-link level2">app.startService(options)</a>
                </li><!----><!--]--><!--[-->
                <li class="toc-item"><a aria-current="page"
                    href="https://pro.autojs.org/docs/zh/v8/app.html#app-sendbroadcast-name"
                    class="router-link-active router-link-exact-active toc-link level2">app.sendBroadcast(name)</a></li>
                <!----><!--]--><!--[-->
                <li class="toc-item"><a aria-current="page"
                    href="https://pro.autojs.org/docs/zh/v8/app.html#app-intenttoshell-options"
                    class="router-link-active router-link-exact-active toc-link level2">app.intentToShell(options)</a>
                </li><!----><!--]--><!--[-->
                <li class="toc-item"><a aria-current="page"
                    href="https://pro.autojs.org/docs/zh/v8/app.html#app-parseuri-uri"
                    class="router-link-active router-link-exact-active toc-link level2">app.parseUri(uri)</a></li>
                <!----><!--]--><!--[-->
                <li class="toc-item"><a aria-current="page"
                    href="https://pro.autojs.org/docs/zh/v8/app.html#app-geturiforfile-path"
                    class="router-link-active router-link-exact-active toc-link level2">app.getUriForFile(path)</a></li>
                <!----><!--]--><!--[-->
                <li class="toc-item"><a aria-current="page"
                    href="https://pro.autojs.org/docs/zh/v8/app.html#app-getinstalledapps-options"
                    class="router-link-active router-link-exact-active toc-link level2">app.getInstalledApps([options])</a>
                </li><!----><!--]-->
              </ul>
            </div>
          </aside>
        </div><!---->
        <div class="theme-hope-content">
          <h1 id="app-应用" tabindex="-1"><a class="header-anchor" href="#app-应用" aria-hidden="true">#</a> app - 应用</h1>
          <p>app模块提供一系列函数，用于使用其他应用、与其他应用交互。例如发送意图、打开文件、发送邮件等。</p>
          <p>同时提供了方便的进阶函数startActivity和sendBroadcast，用他们可完成app模块没有内置的和其他应用的交互。</p>
          <h2 id="app-versioncode" tabindex="-1"><a class="header-anchor" href="#app-versioncode"
              aria-hidden="true">#</a> app.versionCode</h2>
          <ul>
            <li>{number}</li>
          </ul>
          <p>当前软件版本号，整数值。例如160, 256等。</p>
          <p>如果在Auto.js中运行则为Auto.js的版本号；在打包的软件中则为打包软件的版本号。</p>
          <div class="language-javascript ext-js line-numbers-mode">
            <pre class="language-javascript"><code><span class="token function">toastLog</span><span class="token punctuation">(</span>app<span class="token punctuation">.</span>versionCode<span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre>
            <div class="line-numbers" aria-hidden="true">
              <div class="line-number"></div>
            </div>
          </div>
          <h2 id="app-versionname" tabindex="-1"><a class="header-anchor" href="#app-versionname"
              aria-hidden="true">#</a> app.versionName</h2>
          <ul>
            <li>{string}</li>
          </ul>
          <p>当前软件的版本名称，例如&quot;3.0.0 Beta&quot;。</p>
          <p>如果在Auto.js中运行则为Auto.js的版本名称；在打包的软件中则为打包软件的版本名称。</p>
          <div class="language-javascript ext-js line-numbers-mode">
            <pre class="language-javascript"><code><span class="token function">toastLog</span><span class="token punctuation">(</span>app<span class="token punctuation">.</span>versionName<span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre>
            <div class="line-numbers" aria-hidden="true">
              <div class="line-number"></div>
            </div>
          </div>
          <h2 id="app-autojs-versioncode" tabindex="-1"><a class="header-anchor" href="#app-autojs-versioncode"
              aria-hidden="true">#</a> app.autojs.versionCode</h2>
          <ul>
            <li>{number}</li>
          </ul>
          <p>Auto.js版本号，整数值。例如160, 256等。</p>
          <h2 id="app-autojs-versionname" tabindex="-1"><a class="header-anchor" href="#app-autojs-versionname"
              aria-hidden="true">#</a> app.autojs.versionName</h2>
          <ul>
            <li>{string}</li>
          </ul>
          <p>Auto.js版本名称，例如&quot;3.0.0 Beta&quot;。</p>
          <h2 id="app-launchapp-appname" tabindex="-1"><a class="header-anchor" href="#app-launchapp-appname"
              aria-hidden="true">#</a> app.launchApp(appName)</h2>
          <ul>
            <li><code><span class="token property">appName</span></code> {string} 应用名称</li>
          </ul>
          <p>通过应用名称启动应用。如果该名称对应的应用不存在，则返回false; 否则返回true。如果该名称对应多个应用，则只启动其中某一个。</p>
          <p>该函数也可以作为全局函数使用。</p>
          <div class="language-javascript ext-js line-numbers-mode">
            <pre class="language-javascript"><code><span class="token function">launchApp</span><span class="token punctuation">(</span><span class="token string">&quot;Auto.js&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre>
            <div class="line-numbers" aria-hidden="true">
              <div class="line-number"></div>
            </div>
          </div>
          <h2 id="app-launch-packagename" tabindex="-1"><a class="header-anchor" href="#app-launch-packagename"
              aria-hidden="true">#</a> app.launch(packageName)</h2>
          <ul>
            <li><code><span class="token property">packageName</span></code> {string} 应用包名</li>
          </ul>
          <p>通过应用包名启动应用。如果该包名对应的应用不存在，则返回false；否则返回true。</p>
          <p>该函数也可以作为全局函数使用。</p>
          <div class="language-javascript ext-js line-numbers-mode">
            <pre class="language-javascript"><code><span class="token comment">//启动微信</span>
<span class="token function">launch</span><span class="token punctuation">(</span><span class="token string">&quot;com.tencent.mm&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre>
            <div class="line-numbers" aria-hidden="true">
              <div class="line-number"></div>
              <div class="line-number"></div>
            </div>
          </div>
          <h2 id="app-launchpackage-packagename" tabindex="-1"><a class="header-anchor"
              href="#app-launchpackage-packagename" aria-hidden="true">#</a> app.launchPackage(packageName)</h2>
          <ul>
            <li><code><span class="token property">packageName</span></code> {string} 应用包名</li>
          </ul>
          <p>
            相当于<code>app<span class="token punctuation">.</span><span class="token function">launch</span><span class="token punctuation">(</span>packageName<span class="token punctuation">)</span></code>。
          </p>
          <h2 id="app-getpackagename-appname" tabindex="-1"><a class="header-anchor" href="#app-getpackagename-appname"
              aria-hidden="true">#</a> app.getPackageName(appName)</h2>
          <ul>
            <li><code><span class="token property">appName</span></code> {string} 应用名称</li>
          </ul>
          <p>获取应用名称对应的已安装的应用的包名。如果该找不到该应用，返回null；如果该名称对应多个应用，则只返回其中某一个的包名。</p>
          <p>该函数也可以作为全局函数使用。</p>
          <div class="language-javascript ext-js line-numbers-mode">
            <pre class="language-javascript"><code><span class="token keyword">var</span> name <span class="token operator">=</span> <span class="token function">getPackageName</span><span class="token punctuation">(</span><span class="token string">&quot;QQ&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token comment">//返回&quot;com.tencent.mobileqq&quot;</span>
</code></pre>
            <div class="line-numbers" aria-hidden="true">
              <div class="line-number"></div>
            </div>
          </div>
          <h2 id="app-getappname-packagename" tabindex="-1"><a class="header-anchor" href="#app-getappname-packagename"
              aria-hidden="true">#</a> app.getAppName(packageName)</h2>
          <ul>
            <li><code><span class="token property">packageName</span></code> {string} 应用包名</li>
          </ul>
          <p>获取应用包名对应的已安装的应用的名称。如果该找不到该应用，返回null。</p>
          <p>该函数也可以作为全局函数使用。</p>
          <div class="language-javascript ext-js line-numbers-mode">
            <pre class="language-javascript"><code><span class="token keyword">var</span> name <span class="token operator">=</span> <span class="token function">getAppName</span><span class="token punctuation">(</span><span class="token string">&quot;com.tencent.mobileqq&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token comment">//返回&quot;QQ&quot;</span>
</code></pre>
            <div class="line-numbers" aria-hidden="true">
              <div class="line-number"></div>
            </div>
          </div>
          <h2 id="app-openappsetting-packagename" tabindex="-1"><a class="header-anchor"
              href="#app-openappsetting-packagename" aria-hidden="true">#</a> app.openAppSetting(packageName)</h2>
          <ul>
            <li><code><span class="token property">packageName</span></code> {string} 应用包名</li>
          </ul>
          <p>打开应用的详情页(设置页)。如果找不到该应用，返回false; 否则返回true。</p>
          <p>该函数也可以作为全局函数使用。</p>
          <h2 id="app-viewfile-path" tabindex="-1"><a class="header-anchor" href="#app-viewfile-path"
              aria-hidden="true">#</a> app.viewFile(path)</h2>
          <ul>
            <li><code><span class="token property">path</span></code> {string} 文件路径</li>
          </ul>
          <p>用其他应用查看文件。文件不存在的情况由查看文件的应用处理。</p>
          <p>如果找不出可以查看该文件的应用，则抛出<code><span class="token property">ActivityNotException</span></code>。</p>
          <div class="language-javascript ext-js line-numbers-mode">
            <pre class="language-javascript"><code><span class="token comment">//查看文本文件</span>
app<span class="token punctuation">.</span><span class="token function">viewFile</span><span class="token punctuation">(</span><span class="token string">&quot;/sdcard/1.txt&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre>
            <div class="line-numbers" aria-hidden="true">
              <div class="line-number"></div>
              <div class="line-number"></div>
            </div>
          </div>
          <h2 id="app-editfile-path" tabindex="-1"><a class="header-anchor" href="#app-editfile-path"
              aria-hidden="true">#</a> app.editFile(path)</h2>
          <ul>
            <li><code><span class="token property">path</span></code> {string} 文件路径</li>
          </ul>
          <p>用其他应用编辑文件。文件不存在的情况由编辑文件的应用处理。</p>
          <p>如果找不出可以编辑该文件的应用，则抛出<code><span class="token property">ActivityNotException</span></code>。</p>
          <div class="language-javascript ext-js line-numbers-mode">
            <pre class="language-javascript"><code><span class="token comment">//编辑文本文件</span>
app<span class="token punctuation">.</span><span class="token function">editFile</span><span class="token punctuation">(</span>&quot;<span class="token operator">/</span>sdcard<span class="token operator">/</span><span class="token number">1</span><span class="token punctuation">.</span>txt<span class="token operator">/</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre>
            <div class="line-numbers" aria-hidden="true">
              <div class="line-number"></div>
              <div class="line-number"></div>
            </div>
          </div>
          <h2 id="app-uninstall-packagename" tabindex="-1"><a class="header-anchor" href="#app-uninstall-packagename"
              aria-hidden="true">#</a> app.uninstall(packageName)</h2>
          <ul>
            <li><code><span class="token property">packageName</span></code> {string} 应用包名</li>
          </ul>
          <p>卸载应用。执行后会会弹出卸载应用的提示框。如果该包名的应用未安装，由应用卸载程序处理，可能弹出&quot;未找到应用&quot;的提示。</p>
          <div class="language-javascript ext-js line-numbers-mode">
            <pre class="language-javascript"><code><span class="token comment">//卸载QQ</span>
app<span class="token punctuation">.</span><span class="token function">uninstall</span><span class="token punctuation">(</span><span class="token string">&quot;com.tencent.mobileqq&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre>
            <div class="line-numbers" aria-hidden="true">
              <div class="line-number"></div>
              <div class="line-number"></div>
            </div>
          </div>
          <h2 id="app-openurl-url" tabindex="-1"><a class="header-anchor" href="#app-openurl-url"
              aria-hidden="true">#</a> app.openUrl(url)</h2>
          <ul>
            <li><code><span class="token property">url</span></code> {string}
              网站的Url，如果不以&quot;http://&quot;或&quot;https://&quot;开头则默认是&quot;http://&quot;。</li>
          </ul>
          <p>用浏览器打开网站url。</p>
          <p>如果没有安装浏览器应用，则抛出<code><span class="token property">ActivityNotException</span></code>。</p>
          <h2 id="app-sendemail-options" tabindex="-1"><a class="header-anchor" href="#app-sendemail-options"
              aria-hidden="true">#</a> app.sendEmail(options)</h2>
          <ul>
            <li><code><span class="token property">options</span></code> {Object} 发送邮件的参数。包括:</li>
            <li><code><span class="token property">email</span></code> {string} | {Array} 收件人的邮件地址。如果有多个收件人，则用字符串数组表示
            </li>
            <li><code><span class="token property">cc</span></code> {string} | {Array} 抄送收件人的邮件地址。如果有多个抄送收件人，则用字符串数组表示
            </li>
            <li><code><span class="token property">bcc</span></code> {string} | {Array} 密送收件人的邮件地址。如果有多个密送收件人，则用字符串数组表示
            </li>
            <li><code><span class="token property">subject</span></code> {string} 邮件主题(标题)</li>
            <li><code><span class="token property">text</span></code> {string} 邮件正文</li>
            <li><code><span class="token property">attachment</span></code> {string} 附件的路径。</li>
          </ul>
          <p>根据选项options调用邮箱应用发送邮件。这些选项均是可选的。</p>
          <p>如果没有安装邮箱应用，则抛出<code><span class="token property">ActivityNotException</span></code>。</p>
          <div class="language-javascript ext-js line-numbers-mode">
            <pre class="language-javascript"><code><span class="token comment">//发送邮件给10086@qq.com和10001@qq.com。</span>
app<span class="token punctuation">.</span><span class="token function">sendEmail</span><span class="token punctuation">(</span><span class="token punctuation">{</span>
    <span class="token literal-property property">email</span><span class="token operator">:</span> <span class="token punctuation">[</span><span class="token string">&quot;10086@qq.com&quot;</span><span class="token punctuation">,</span> <span class="token string">&quot;10001@qq.com&quot;</span><span class="token punctuation">]</span><span class="token punctuation">,</span>
    <span class="token literal-property property">subject</span><span class="token operator">:</span> <span class="token string">&quot;这是一个邮件标题&quot;</span><span class="token punctuation">,</span>
    <span class="token literal-property property">text</span><span class="token operator">:</span> <span class="token string">&quot;这是邮件正文&quot;</span>
<span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre>
            <div class="line-numbers" aria-hidden="true">
              <div class="line-number"></div>
              <div class="line-number"></div>
              <div class="line-number"></div>
              <div class="line-number"></div>
              <div class="line-number"></div>
              <div class="line-number"></div>
            </div>
          </div>
          <h2 id="app-startactivity-name" tabindex="-1"><a class="header-anchor" href="#app-startactivity-name"
              aria-hidden="true">#</a> app.startActivity(name)</h2>
          <ul>
            <li><code><span class="token property">name</span></code> {string} 活动名称，可选的值为: <ul>
                <li><code><span class="token property">console</span></code> 日志界面</li>
                <li><code><span class="token property">settings</span></code> 设置界面</li>
              </ul>
            </li>
          </ul>
          <p>启动Auto.js的特定界面。该函数在Auto.js内运行则会打开Auto.js内的界面，在打包应用中运行则会打开打包应用的相应界面。</p>
          <div class="language-javascript ext-js line-numbers-mode">
            <pre class="language-javascript"><code>app<span class="token punctuation">.</span><span class="token function">startActivity</span><span class="token punctuation">(</span><span class="token string">&quot;console&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre>
            <div class="line-numbers" aria-hidden="true">
              <div class="line-number"></div>
            </div>
          </div>
          <h2 id="app-intent-options" tabindex="-1"><a class="header-anchor" href="#app-intent-options"
              aria-hidden="true">#</a> app.intent(options)</h2>
          <ul>
            <li><code><span class="token property">options</span></code> {Object} 选项，包括： <ul>
                <li>
                  <p><code><span class="token property">action</span></code> {string}
                    意图的Action，指意图要完成的动作，是一个字符串常量，比如&quot;android.intent.action.SEND&quot;。当action以&quot;android.intent.action&quot;开头时，可以省略前缀，直接用&quot;SEND&quot;代替。参见<a
                      href="https://developer.android.com/reference/android/content/Intent.html#standard-activity-actions"
                      target="_blank" rel="noopener noreferrer">Actions<span><svg class="external-link-icon"
                          xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px"
                          viewBox="0 0 100 100" width="15" height="15">
                          <path fill="currentColor"
                            d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z">
                          </path>
                          <polygon fill="currentColor"
                            points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9">
                          </polygon>
                        </svg><span class="external-link-icon-sr-only">open in new window</span></span></a>。</p>
                </li>
                <li>
                  <p><code><span class="token property">type</span></code> {string}
                    意图的MimeType，表示和该意图直接相关的数据的类型，表示比如&quot;text/plain&quot;为纯文本类型。</p>
                </li>
                <li>
                  <p><code><span class="token property">data</span></code> {string} 意图的Data，表示和该意图直接相关的数据，是一个Uri,
                    可以是文件路径或者Url等。例如要打开一个文件, action为&quot;android.intent.action.VIEW&quot;,
                    data为&quot;file:///sdcard/1.txt&quot;。</p>
                </li>
                <li>
                  <p><code><span class="token property">category</span></code> {Array} 意图的类别。比较少用。参见<a
                      href="https://developer.android.com/reference/android/content/Intent.html#standard-categories"
                      target="_blank" rel="noopener noreferrer">Categories<span><svg class="external-link-icon"
                          xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px"
                          viewBox="0 0 100 100" width="15" height="15">
                          <path fill="currentColor"
                            d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z">
                          </path>
                          <polygon fill="currentColor"
                            points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9">
                          </polygon>
                        </svg><span class="external-link-icon-sr-only">open in new window</span></span></a>。</p>
                </li>
                <li>
                  <p><code><span class="token property">packageName</span></code> {string} 目标包名</p>
                </li>
                <li>
                  <p><code><span class="token property">className</span></code> {string} 目标Activity或Service等组件的名称</p>
                </li>
                <li>
                  <p><code><span class="token property">extras</span></code> {Object}
                    以键值对构成的这个Intent的Extras(额外信息)。提供该意图的其他信息，例如发送邮件时的邮件标题、邮件正文。参见<a
                      href="https://developer.android.com/reference/android/content/Intent.html#standard-extra-data"
                      target="_blank" rel="noopener noreferrer">Extras<span><svg class="external-link-icon"
                          xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px"
                          viewBox="0 0 100 100" width="15" height="15">
                          <path fill="currentColor"
                            d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z">
                          </path>
                          <polygon fill="currentColor"
                            points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9">
                          </polygon>
                        </svg><span class="external-link-icon-sr-only">open in new window</span></span></a>。</p>
                </li>
                <li>
                  <p><code><span class="token property">flags</span></code> {Array}
                    intent的标识，字符串数组，例如<code><span class="token punctuation">[</span><span class="token string">&quot;activity_new_task&quot;</span><span class="token punctuation">,</span> <span class="token string">&quot;grant_read_uri_permission&quot;</span><span class="token punctuation">]</span></code>。参见<a
                      href="https://developer.android.com/reference/android/content/Intent.html#setFlags%28int%29"
                      target="_blank" rel="noopener noreferrer">Flags<span><svg class="external-link-icon"
                          xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px"
                          viewBox="0 0 100 100" width="15" height="15">
                          <path fill="currentColor"
                            d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z">
                          </path>
                          <polygon fill="currentColor"
                            points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9">
                          </polygon>
                        </svg><span class="external-link-icon-sr-only">open in new window</span></span></a>。</p>
                  <p><strong>[v4.1.0新增]</strong></p>
                </li>
                <li>
                  <p><code><span class="token property">root</span></code> {Boolean}
                    是否以root权限启动、发送该intent。使用该参数后，不能使用<code>context<span class="token punctuation">.</span><span class="token function">startActivity</span><span class="token punctuation">(</span><span class="token punctuation">)</span></code>等方法，而应该直接使用诸如<code>app<span class="token punctuation">.</span><span class="token function">startActivity</span><span class="token punctuation">(</span><span class="token punctuation">{</span><span class="token operator">...</span><span class="token punctuation">}</span><span class="token punctuation">)</span></code>的方法。
                  </p>
                  <p><strong>[v4.1.0新增]</strong></p>
                </li>
              </ul>
            </li>
          </ul>
          <p>根据选项，构造一个意图Intent对象。</p>
          <p>例如：</p>
          <div class="language-javascript ext-js line-numbers-mode">
            <pre class="language-javascript"><code><span class="token comment">//打开应用来查看图片文件</span>
<span class="token keyword">var</span> i <span class="token operator">=</span> app<span class="token punctuation">.</span><span class="token function">intent</span><span class="token punctuation">(</span><span class="token punctuation">{</span>
    <span class="token literal-property property">action</span><span class="token operator">:</span> <span class="token string">&quot;VIEW&quot;</span><span class="token punctuation">,</span>
    <span class="token literal-property property">type</span><span class="token operator">:</span> <span class="token string">&quot;image/png&quot;</span><span class="token punctuation">,</span>
    <span class="token literal-property property">data</span><span class="token operator">:</span> <span class="token string">&quot;file:///sdcard/1.png&quot;</span>
<span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
context<span class="token punctuation">.</span><span class="token function">startActivity</span><span class="token punctuation">(</span>i<span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre>
            <div class="line-numbers" aria-hidden="true">
              <div class="line-number"></div>
              <div class="line-number"></div>
              <div class="line-number"></div>
              <div class="line-number"></div>
              <div class="line-number"></div>
              <div class="line-number"></div>
              <div class="line-number"></div>
            </div>
          </div>
          <p>Intent(意图) 是一个消息传递对象，您可以使用它从其他应用组件请求操作。尽管 Intent 可以通过多种方式促进组件之间的通信，但其基本用例主要包括以下三个：</p>
          <ul>
            <li>
              <p>启动活动(Activity)： Activity
                表示应用中的一个&quot;屏幕&quot;。例如应用主入口都是一个Activity，应用的功能通常也以Activity的形式独立，例如微信的主界面、朋友圈、聊天窗口都是不同的Activity。通过将
                Intent 传递给 startActivity()，您可以启动新的 Activity 实例。Intent 描述了要启动的 Activity，并携带了任何必要的数据。</p>
            </li>
            <li>
              <p>启动服务(Service)： Service 是一个不使用用户界面而在后台执行操作的组件。通过将 Intent 传递给
                startService()，您可以启动服务执行一次性操作（例如，下载文件）。Intent 描述了要启动的服务，并携带了任何必要的数据。</p>
            </li>
            <li>
              <p>传递广播： 广播是任何应用均可接收的消息。系统将针对系统事件（例如：系统启动或设备开始充电时）传递各种广播。通过将 Intent 传递给
                sendBroadcast()、sendOrderedBroadcast() 或 sendStickyBroadcast()，您可以将广播传递给其他应用。</p>
            </li>
          </ul>
          <p>
            需要注意的是，除非应用专门暴露Activity出来，否则在没有root权限的情况下使用intent是无法跳转到特定Activity、应用的特定界面的。例如我们能通过Intent跳转到QQ的分享界面，是因为QQ对外暴露了分享的Activity；而在没有root权限的情况下，我们无法通过intent跳转到QQ的设置界面，因为QQ并没有暴露这个Activity。
          </p>
          <p>
            但如果有root权限，则在intent的参数加上<code><span class="token string-property property">&quot;root&quot;</span><span class="token operator">:</span> <span class="token boolean">true</span></code>即可。例如使用root权限跳转到Auto.js的设置界面为：
          </p>
          <div class="language-javascript ext-js line-numbers-mode">
            <pre class="language-javascript"><code>app<span class="token punctuation">.</span><span class="token function">startActivity</span><span class="token punctuation">(</span><span class="token punctuation">{</span>
    <span class="token literal-property property">packageName</span><span class="token operator">:</span> <span class="token string">&quot;org.autojs.autojs&quot;</span><span class="token punctuation">,</span>
    <span class="token literal-property property">className</span><span class="token operator">:</span> <span class="token string">&quot;org.autojs.autojs.ui.settings.SettingsActivity_&quot;</span><span class="token punctuation">,</span>
    <span class="token literal-property property">root</span><span class="token operator">:</span> <span class="token boolean">true</span>
<span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre>
            <div class="line-numbers" aria-hidden="true">
              <div class="line-number"></div>
              <div class="line-number"></div>
              <div class="line-number"></div>
              <div class="line-number"></div>
              <div class="line-number"></div>
            </div>
          </div>
          <p>
            另外，关于intent的参数如何获取的问题，一些intent是意外发现并且在网络中传播的（例如跳转QQ聊天窗口是因为QQ给网页提供了跳转到客服QQ的方法），如果要自己获取活动的intent的参数，可以通过例如&quot;intent记录&quot;，&quot;隐式启动&quot;等应用拦截内部intent或者查询暴露的intent。其中拦截内部intent需要XPosed框架，或者可以通过反编译等手段获取参数。总之，没有简单直接的方法。
          </p>
          <p>更多信息，请百度<a href="https://www.baidu.com/s?wd=android Intent" target="_blank"
              rel="noopener noreferrer">安卓Intent<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg"
                  aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15">
                  <path fill="currentColor"
                    d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z">
                  </path>
                  <polygon fill="currentColor"
                    points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9">
                  </polygon>
                </svg><span class="external-link-icon-sr-only">open in new window</span></span></a>或参考<a
              href="https://developer.android.com/guide/components/intents-filters.html#Types" target="_blank"
              rel="noopener noreferrer">Android指南: Intent<span><svg class="external-link-icon"
                  xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px"
                  viewBox="0 0 100 100" width="15" height="15">
                  <path fill="currentColor"
                    d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z">
                  </path>
                  <polygon fill="currentColor"
                    points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9">
                  </polygon>
                </svg><span class="external-link-icon-sr-only">open in new window</span></span></a>。</p>
          <h2 id="app-startactivity-options" tabindex="-1"><a class="header-anchor" href="#app-startactivity-options"
              aria-hidden="true">#</a> app.startActivity(options)</h2>
          <ul>
            <li><code><span class="token property">options</span></code> {Object} 选项</li>
          </ul>
          <p>根据选项构造一个Intent，并启动该Activity。</p>
          <div class="language-javascript ext-js line-numbers-mode">
            <pre class="language-javascript"><code>app<span class="token punctuation">.</span><span class="token function">startActivity</span><span class="token punctuation">(</span><span class="token punctuation">{</span>
    <span class="token literal-property property">action</span><span class="token operator">:</span> <span class="token string">&quot;SEND&quot;</span><span class="token punctuation">,</span>
    <span class="token literal-property property">type</span><span class="token operator">:</span> <span class="token string">&quot;text/plain&quot;</span><span class="token punctuation">,</span>
    <span class="token literal-property property">data</span><span class="token operator">:</span> <span class="token string">&quot;file:///sdcard/1.txt&quot;</span>
<span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre>
            <div class="line-numbers" aria-hidden="true">
              <div class="line-number"></div>
              <div class="line-number"></div>
              <div class="line-number"></div>
              <div class="line-number"></div>
              <div class="line-number"></div>
            </div>
          </div>
          <h2 id="app-sendbroadcast-options" tabindex="-1"><a class="header-anchor" href="#app-sendbroadcast-options"
              aria-hidden="true">#</a> app.sendBroadcast(options)</h2>
          <ul>
            <li><code><span class="token property">options</span></code> {Object} 选项</li>
          </ul>
          <p>根据选项构造一个Intent，并发送该广播。</p>
          <h2 id="app-startservice-options" tabindex="-1"><a class="header-anchor" href="#app-startservice-options"
              aria-hidden="true">#</a> app.startService(options)</h2>
          <ul>
            <li><code><span class="token property">options</span></code> {Object} 选项</li>
          </ul>
          <p>根据选项构造一个Intent，并启动该服务。</p>
          <h2 id="app-sendbroadcast-name" tabindex="-1"><a class="header-anchor" href="#app-sendbroadcast-name"
              aria-hidden="true">#</a> app.sendBroadcast(name)</h2>
          <p><strong>[v4.1.0新增]</strong></p>
          <ul>
            <li><code><span class="token property">name</span></code> {string} 特定的广播名称，包括： <ul>
                <li><code><span class="token property">inspect_layout_hierarchy</span></code> 布局层次分析</li>
                <li><code><span class="token property">inspect_layout_bounds</span></code> 布局范围</li>
              </ul>
            </li>
          </ul>
          <p>发送以上特定名称的广播可以触发Auto.js的布局分析，方便脚本调试。这些广播在Auto.js发送才有效，在打包的脚本上运行将没有任何效果。</p>
          <div class="language-javascript ext-js line-numbers-mode">
            <pre class="language-javascript"><code>app<span class="token punctuation">.</span><span class="token function">sendBroadcast</span><span class="token punctuation">(</span><span class="token string">&quot;inspect_layout_bounds&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre>
            <div class="line-numbers" aria-hidden="true">
              <div class="line-number"></div>
            </div>
          </div>
          <h2 id="app-intenttoshell-options" tabindex="-1"><a class="header-anchor" href="#app-intenttoshell-options"
              aria-hidden="true">#</a> app.intentToShell(options)</h2>
          <p><strong>[v4.1.0新增]</strong></p>
          <ul>
            <li><code><span class="token property">options</span></code> {Object} 选项</li>
          </ul>
          <p>根据选项构造一个Intent，转换为对应的shell的intent命令的参数。</p>
          <p>例如:</p>
          <div class="language-javascript ext-js line-numbers-mode">
            <pre class="language-javascript"><code><span class="token function">shell</span><span class="token punctuation">(</span><span class="token string">&quot;am start &quot;</span> <span class="token operator">+</span> app<span class="token punctuation">.</span><span class="token function">intentToShell</span><span class="token punctuation">(</span><span class="token punctuation">{</span>
    <span class="token literal-property property">packageName</span><span class="token operator">:</span> <span class="token string">&quot;org.autojs.autojs&quot;</span><span class="token punctuation">,</span>
    <span class="token literal-property property">className</span><span class="token operator">:</span> <span class="token string">&quot;org.autojs.autojs.ui.settings.SettingsActivity_&quot;</span>
<span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token boolean">true</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre>
            <div class="line-numbers" aria-hidden="true">
              <div class="line-number"></div>
              <div class="line-number"></div>
              <div class="line-number"></div>
              <div class="line-number"></div>
            </div>
          </div>
          <p>参见<a href="https://developer.android.com/studio/command-line/adb#IntentSpec" target="_blank"
              rel="noopener noreferrer">intent参数的规范<span><svg class="external-link-icon"
                  xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px"
                  viewBox="0 0 100 100" width="15" height="15">
                  <path fill="currentColor"
                    d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z">
                  </path>
                  <polygon fill="currentColor"
                    points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9">
                  </polygon>
                </svg><span class="external-link-icon-sr-only">open in new window</span></span></a>。</p>
          <h2 id="app-parseuri-uri" tabindex="-1"><a class="header-anchor" href="#app-parseuri-uri"
              aria-hidden="true">#</a> app.parseUri(uri)</h2>
          <p><strong>[v4.1.0新增]</strong></p>
          <ul>
            <li><code><span class="token property">uri</span></code> {string}
              一个代表Uri的字符串，例如&quot;file:///sdcard/1.txt&quot;, &quot;https://www.autojs.org&quot;</li>
            <li>返回 {Uri} 一个代表Uri的对象，参见<a href="https://developer.android.com/reference/android/net/Uri" target="_blank"
                rel="noopener noreferrer">android.net.Uri<span><svg class="external-link-icon"
                    xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px"
                    viewBox="0 0 100 100" width="15" height="15">
                    <path fill="currentColor"
                      d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z">
                    </path>
                    <polygon fill="currentColor"
                      points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9">
                    </polygon>
                  </svg><span class="external-link-icon-sr-only">open in new window</span></span></a>。</li>
          </ul>
          <p>解析uri字符串并返回相应的Uri对象。即使Uri格式错误，该函数也会返回一个Uri对象，但之后如果访问该对象的scheme,
            path等值可能因解析失败而返回<code><span class="token keyword">null</span></code>。</p>
          <p>
            需要注意的是，在高版本Android上，由于系统限制直接在Uri暴露文件的绝对路径，因此如果uri字符串是文件<code><span class="token literal-property property">file</span><span class="token operator">:</span><span class="token operator">/</span><span class="token operator">/</span><span class="token operator">...</span></code>，返回的Uri会是诸如<code><span class="token literal-property property">content</span><span class="token operator">:</span><span class="token operator">/</span><span class="token operator">/</span><span class="token operator">...</span></code>的形式。
          </p>
          <h2 id="app-geturiforfile-path" tabindex="-1"><a class="header-anchor" href="#app-geturiforfile-path"
              aria-hidden="true">#</a> app.getUriForFile(path)</h2>
          <p><strong>[v4.1.0新增]</strong></p>
          <ul>
            <li><code><span class="token property">path</span></code> {string} 文件路径，例如&quot;/sdcard/1.txt&quot;</li>
            <li>返回 {Uri} 一个指向该文件的Uri的对象，参见<a href="https://developer.android.com/reference/android/net/Uri"
                target="_blank" rel="noopener noreferrer">android.net.Uri<span><svg class="external-link-icon"
                    xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px"
                    viewBox="0 0 100 100" width="15" height="15">
                    <path fill="currentColor"
                      d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z">
                    </path>
                    <polygon fill="currentColor"
                      points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9">
                    </polygon>
                  </svg><span class="external-link-icon-sr-only">open in new window</span></span></a>。</li>
          </ul>
          <p>
            从一个文件路径创建一个uri对象。需要注意的是，在高版本Android上，由于系统限制直接在Uri暴露文件的绝对路径，因此返回的Uri会是诸如<code><span class="token literal-property property">content</span><span class="token operator">:</span><span class="token operator">/</span><span class="token operator">/</span><span class="token operator">...</span></code>的形式。
          </p>
          <h2 id="app-getinstalledapps-options" tabindex="-1"><a class="header-anchor"
              href="#app-getinstalledapps-options" aria-hidden="true">#</a> app.getInstalledApps([options])</h2>
          <p>** [<a href="../../../pro.autojs.html" target="_blank" rel="noopener noreferrer">Pro 8.0.0新增<span><svg
                  class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"
                  x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15">
                  <path fill="currentColor"
                    d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z">
                  </path>
                  <polygon fill="currentColor"
                    points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9">
                  </polygon>
                </svg><span class="external-link-icon-sr-only">open in new window</span></span></a>] **</p>
          <ul>
            <li><code><span class="token property">options</span></code> {Object} 选项，包括： <ul>
                <li><code><span class="token keyword">get</span></code>: 指定返回的应用信息中包含的信息 <ul>
                    <li><code><span class="token string">&quot;activities&quot;</span></code> 应用的Activity组件信息</li>
                    <li><code><span class="token string">&quot;configurations&quot;</span></code> 应用的硬件配置</li>
                    <li><code><span class="token string">&quot;gids&quot;</span></code> 应用的group id</li>
                    <li><code><span class="token string">&quot;instrumentation&quot;</span></code> 应用的Instrumentation信息
                    </li>
                    <li><code><span class="token string">&quot;intent_filters&quot;</span></code> 应用的意图过滤</li>
                    <li><code><span class="token string">&quot;meta_data&quot;</span></code> 应用的元信息（默认）</li>
                    <li><code><span class="token string">&quot;permissions&quot;</span></code> 应用的权限信息</li>
                    <li><code><span class="token string">&quot;providers&quot;</span></code> 应用的ContentProvider组件信息</li>
                    <li><code><span class="token string">&quot;receivers&quot;</span></code> 应用的BroadcastReceiver组件信息
                    </li>
                    <li><code><span class="token string">&quot;services&quot;</span></code> 应用的Service组件信息</li>
                    <li><code><span class="token string">&quot;shared_library_files&quot;</span></code> 应用的动态链接库文件信息
                    </li>
                    <li><code><span class="token string">&quot;signatures&quot;</span></code> 应用的签名信息（已弃用</li>
                    <li><code><span class="token string">&quot;signing_certificates&quot;</span></code> 应用的签名信息</li>
                    <li><code><span class="token string">&quot;uri_permission_patterns&quot;</span></code></li>
                    <li><code><span class="token string">&quot;disabled_components&quot;</span></code> 被卸载的但保留了数据的应用
                    </li>
                    <li><code><span class="token string">&quot;disabled_until_used_components&quot;</span></code>
                      禁用直到被使用的组件</li>
                    <li><code><span class="token string">&quot;uninstalled_packages&quot;</span></code> 被卸载的但保留了数据的应用
                    </li>
                  </ul>
                </li>
                <li><code><span class="token property">match</span></code>: 指定要匹配的应用列表 <ul>
                    <li><code><span class="token string">&quot;uninstalled_packages&quot;</span></code> 被卸载的但保留了数据的应用
                    </li>
                    <li><code><span class="token string">&quot;disabled_components&quot;</span></code> 被禁用的组件</li>
                    <li><code><span class="token string">&quot;disabled_until_used_components&quot;</span></code>
                      禁用直到被使用的组件</li>
                    <li><code><span class="token string">&quot;system_only&quot;</span></code> 只匹配系统应用</li>
                    <li><code><span class="token string">&quot;factory_only&quot;</span></code> 只匹配预装应用</li>
                    <li><code><span class="token string">&quot;apex&quot;</span></code> APEX应用</li>
                  </ul>
                </li>
              </ul>
            </li>
            <li>返回 {Array&lt;ApplicationInfo&gt;}</li>
          </ul>
          <p>返回为当前用户安装的所有应用程序包的列表。如果设置了match选项
            <code><span class="token property">uninstalled_packages</span></code>，则包括被删除但保留了数据的应用程序。 获取安装的应用列表。
          </p>
          <p>返回值是ApplicationInfo对象的数组。 如果没有安装任何应用，则返回一个空数组。</p>
          <p>选项options的match选项用于指定要返回哪些应用程序，get选项用于指定返回的应用程序携带哪些信息。</p>
          <div class="language-javascript ext-js line-numbers-mode">
            <pre class="language-javascript"><code><span class="token comment">// 获取系统app</span>
<span class="token keyword">let</span> apps <span class="token operator">=</span> $app<span class="token punctuation">.</span><span class="token function">getInstalledApps</span><span class="token punctuation">(</span><span class="token punctuation">{</span>
    <span class="token literal-property property">get</span><span class="token operator">:</span> <span class="token punctuation">[</span><span class="token string">&#39;meta_data&#39;</span><span class="token punctuation">]</span><span class="token punctuation">,</span>
    <span class="token literal-property property">match</span><span class="token operator">:</span> <span class="token punctuation">[</span><span class="token string">&#39;system_only&#39;</span><span class="token punctuation">]</span>
<span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
console<span class="token punctuation">.</span><span class="token function">log</span><span class="token punctuation">(</span>apps<span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre>
            <div class="line-numbers" aria-hidden="true">
              <div class="line-number"></div>
              <div class="line-number"></div>
              <div class="line-number"></div>
              <div class="line-number"></div>
              <div class="line-number"></div>
              <div class="line-number"></div>
            </div>
          </div>
        </div><!---->
        <footer class="page-meta"><!---->
          <div class="meta-item update-time"><span class="label">上次编辑于: </span><!----></div>
          <div class="meta-item contributors"><span class="label">贡献者: </span><!--[--><!--[--><span class="contributor"
              title="email: 946994919@qq.com">hyb1996</span><!--]--><!--]--></div>
        </footer>
        <nav class="page-nav"><!----><a href="base64.html" class="nav-link next" aria-label="base64">
            <div class="hint">下一页<span class="arrow right"></span></div>
            <div class="link">base64<!----></div>
          </a></nav><!----><!----><!--]-->
      </main><!--]--><!----><!--]-->
    </div><!--]--><!----><!----><!--]-->
  </div>
  <script type="module" src="../../assets/app.6aa2b576.js" defer></script>
</body>

</html>